$OpenBSD: patch-lib_fileutils_rb,v 1.1.1.1 2014/01/03 17:51:52 jeremy Exp $

Make FileUtils.mkdir_p act more like mkdir(1) -p, by not attempting
to create directories that already exist.  This fixes systrace
warnings when building ports.

--- lib/fileutils.rb.orig	Sat Dec  7 02:25:33 2013
+++ lib/fileutils.rb	Thu Dec 26 19:20:07 2013
@@ -208,7 +208,7 @@ module FileUtils
     list.map {|path| remove_tailing_slash(path)}.each do |path|
       # optimize for the most common case
       begin
-        fu_mkdir path, options[:mode]
+        fu_mkdir path, options[:mode] unless File.directory?(path)
         next
       rescue SystemCallError
         next if File.directory?(path)
@@ -221,7 +221,7 @@ module FileUtils
       end
       stack.reverse_each do |dir|
         begin
-          fu_mkdir dir, options[:mode]
+          fu_mkdir dir, options[:mode] unless File.directory?(dir)
         rescue SystemCallError
           raise unless File.directory?(dir)
         end
